
% Run training
Yk = bsxfun(@eq, Y, [1 2 4 5]);
nb = nb_train_pk([X]'>0, [Yk]);

% Make the testing data, make predictions on test set
Xtest = make_sparse(test, size(X, 2));
Yhat = nb_test_pk(nb, Xtest'>0);

% Calculated Expected Value
ratings = [1 2 4 5];
Yhat = sum(bsxfun(@times, Yhat, ratings),2);

save('-ascii', 'submit.txt', 'Yhat');



